import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    props:true,
    component: Home
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/register',
    name: 'register',
    component: Register
  },
  {
    path: '/shopping',
    component: () => import(/* webpackChunkName: "shopping" */ '../views/Shopping.vue')
  },
  {
    path: '/new',
    props:true,
    component: () => import(/* webpackChunkName: "new" */ '../views/New.vue')
  },
  {
    path: '/special',
    component: () => import(/* webpackChunkName: "special" */ '../views/Special.vue')
  },
  {
    path: '/ranking',
    component: () => import(/* webpackChunkName: "ranking" */ '../views/Ranking.vue')
  },
  {
    path: '/detail/:id',
    props:true,
    component: () => import(/* webpackChunkName: "detail" */ '../views/Detail.vue')
  },
  {
    path: '/about',
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
